package com.example.nbb.Controller;

import com.example.nbb.Service.FootPrintsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@CrossOrigin//跨域
@RestController//遵循RestFul
@RequestMapping("/nbb/FootPrints/")
public class FootPrintsController {
    @Resource
    FootPrintsService footPrintsService;

    @GetMapping("selectAll")
    public String selectAll(@RequestParam("userId") int userId) {
        return footPrintsService.selectAll(userId);
    }

    @PostMapping("addFootPrints")
    public String addFootPrints(@RequestParam("userId") int userId, @RequestParam("productId") int productId) {
        return footPrintsService.addFootPrints(userId, productId);
    }

}
